package cn.webestar.scms.user.api.dto.Employee;

import cn.webestar.scms.commons.api.UpdateBody;
import cn.webestar.scms.user.entity.Employee;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "EmployeeUpdateDTO")
public class EmployeeUpdateDTO extends UpdateBody {

    private Long id;

    @Schema(description = "租户ID")
    private Long cid;

    @Schema(description = "用户id")
    private Long userId;

    @Schema(description = "部门id")
    private Long depId;

    @Schema(description = "员工号")
    private String no;

    @Schema(description = "姓名")
    private String name;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "创建人")
    private Long creator;

    @Schema(description = "更新人")
    private Long updater;

    @Schema(description = "删除人")
    private Long deleter;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "删除时间")
    private Date deleteTime;

    @Schema(description = "是否已删除")
    private Boolean isDeleted;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public Employee toDO() {
        Employee o = new Employee();
        o.setId(id);
        o.setCid(cid);
        o.setUserId(userId);
        o.setDepId(depId);
        o.setNo(no);
        o.setName(name);
        o.setEmail(email);
        o.setCreator(creator);
        o.setUpdater(updater);
        o.setDeleter(deleter);
        o.setCreateTime(createTime);
        o.setUpdateTime(updateTime);
        o.setDeleteTime(deleteTime);
        o.setIsDeleted(isDeleted);
        return o;
    }

}
